﻿/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/

//CKFinder.SetupCKEditor( editor, '/ckfinder/' );
CKEDITOR.editorConfig = function( config )
{
	
	// Define changes to default configuration here. For example:
	// config.language = 'fr';
	// config.uiColor = '#AADC6E';
	/*config.filebrowserBrowseUrl = '/kcfinder/browse.php?type=files';
	config.filebrowserImageBrowseUrl = '/kcfinder/browse.php?type=images';
	config.filebrowserFlashBrowseUrl = '/kcfinder/browse.php?type=flash';
	config.filebrowserUploadUrl = '/kcfinder/upload.php?type=files';
	config.filebrowserImageUploadUrl = '/kcfinder/upload.php?type=images';
	config.filebrowserFlashUploadUrl = '/kcfinder/upload.php?type=flash';*/
	
	//ckeditor的配置都集中在 ckeditor/config.js 文件中，下面是一些常用的配置参数：
	// 界面语言，默认为 'en' 
	//config.language = 'zh-cn';
	// 设置宽高
    //config.width = 400;
    config.height = 480;
	//test
	config.uiColor = '#AADC6E';
	config.filebrowserBrowseUrl = '/cms/kcfinder/browse.kc?act=show&type=file&dir=public';
	config.filebrowserUploadUrl = '/cms/kcfinder/browse.kc?act=upload&type=file&dir=public';
	config.filebrowserFlashBrowseUrl = '/cms/kcfinder/browse.kc?act=show&type=flash&dir=public';
	config.filebrowserFlashUploadUrl = '/cms/kcfinder/browse.kc?act=upload&type=flash&dir=public';
	
	config.filebrowserImageBrowseUrl='/cms/kcfinder/browse.kc?act=show&type=images&dir=public';
	config.filebrowserImageUploadUrl = '/cms/kcfinder/browse.kc?act=upload&type=images&dir=public';

	//编辑器样式，有三种：'kama'（默认）、'office2003'、'v2' 
	config.skin = "v2";
	// 背景颜色
    config.uiColor = '#FFF'; 
    // 工具栏（基础'Basic'、全能'Full'、自定义）plugins/toolbar/plugin.js 
    config.toolbar = 'Full'; 
    /*config.toolbar_Full = [
                           ['Source','-','Save','NewPage','Preview','-','Templates'],
                           ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
                           ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
                           ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
                           '/',
                           ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
                            ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
                            ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
                            ['Link','Unlink','Anchor'],
                           ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
                           '/',
                            ['Styles','Format','Font','FontSize'],['Maximize','ShowBlocks','About']
                            ['TextColor','BGColor']
                        ]; */
    /*config.toolbar_Full = [
                           ['Source'],['PageBreak'],['-','Preview','ShowBlocks','Maximize'],
                           ['Cut','Copy','Paste','PasteText','PasteFromWord','-'],
                           ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['Undo','Redo'],
                           '/',
                           ['Bold','Italic','Underline','Strike'],['TextColor','BGColor'],
                           ['NumberedList','BulletedList'],
                           ['Link','Image','Flash','Table','HorizontalRule','Smiley'],
                           '/',
                           ['Styles','Format','Font','FontSize','SingleQuote','About']
                        ]; */
    config.toolbar_Full =
    	[
    	    { name: 'document',    items : [ 'Source','-','Save','PageBreak','DocProps','Preview','-','Templates' ] },
    	    { name: 'clipboard',   items : [ 'Undo','Redo', '_', 'PasteFromWord' ] },
    	    { name: 'editing',     items : [ 'Find','Replace','-','SelectAll','-'] },
    	    /*{ name: 'forms',       items : [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },*/
    	    { name: 'links',       items : [ 'Link','Unlink','_','ShowBlocks'] },
    	    { name: 'insert',      items : [ 'Image','Flash','Table','HorizontalRule','Smiley' ] },
    	    '/',
    	    { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },
    	    { name: 'colors',      items : [ 'TextColor','BGColor' ] },
    	    { name: 'paragraph',   items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] },
    	    '/',
    	    { name: 'styles',      items : [ 'Styles','Format','Font','FontSize' ] },
    	    { name: 'tools',       items : [ 'Maximize', '-','About' ] }
    	];    
    //工具栏是否可以被收缩
    config.toolbarCanCollapse = false;

    //工具栏的位置
    config.toolbarLocation = 'top';//可选：bottom

    //工具栏默认是否展开
    config.toolbarStartupExpanded = true;

    // 取消 “拖拽以改变尺寸”功能 plugins/resize/plugin.js
    config.resize_enabled = false;

    //改变大小的最大高度
    config.resize_maxHeight = 3000;

    //改变大小的最大宽度
    config.resize_maxWidth = 3000;

    //改变大小的最小高度
    config.resize_minHeight = 250;

    //改变大小的最小宽度
    config.resize_minWidth = 750;
    
    // 当提交包含有此编辑器的表单时，是否自动更新元素内的数据
    config.autoUpdateElement = true;

    // 设置是使用绝对目录还是相对目录，为空为相对目录
    config.baseHref = '';

    // 编辑器的z-index值
    config.baseFloatZIndex = 299; 
    
	//编辑器中回车产生的标签 可选：CKEDITOR.ENTER_P,CKEDITOR.ENTER_BR或CKEDITOR.ENTER_DIV
    config.enterMode = CKEDITOR.ENTER_P;
    config.shiftEnterMode = CKEDITOR.ENTER_DIV;
    
	//是否使用HTML实体进行输出 plugins/entities/plugin.js
    config.entities = false;
    
    config.format_pre = { element : 'pre', attributes : { 'class' : 'code' } };
    
    //word不过滤字符样式
    config.pasteFromWordRemoveStyles = false;
    config.pasteFromWordRemoveFontStyles = false;
    
    //是否强制复制来的内容去除格式 plugins/pastetext/plugin.js
    config.forcePasteAsPlainText = false;
    
    //※自动warp指定tag
    config.autoParagraph = false;
};